package org.gzr.myreflect.getclass;

import org.gzr.myreflect.getclass.entity.Student;

public class MyReflect {
    public static void main(String[] args) throws ClassNotFoundException {
        /**
         * 获取字节码文件的三种方式
         */
        //1.Class这个类里面的静态方法forName
        Class studentClass1 = Class.forName("org.gzr.myreflect.getclass.entity.Student");

        //2.通过class属性获取
        Class studentClass2 = Student.class;

        //3.通过Student对象获取字节码文件对象
        Student student = new Student();
        Class studentClass3 = student.getClass();

        System.out.println(studentClass1==studentClass2);
        System.out.println(studentClass2==studentClass3);
    }

}
